﻿namespace HiMap.MapControls
{
    using System;
    using System.Runtime.InteropServices;

    internal class DrawWork
    {
        private int m_DrawInptr = KWG_DRAWWORK_CREATE();

        public void Destory()
        {
            if (this.m_DrawInptr > 0)
            {
                KWG_DRAWWORK_DELETE(this.m_DrawInptr);
                this.m_DrawInptr = 0;
            }
        }

        ~DrawWork()
        {
            if (this.m_DrawInptr > 0)
            {
                KWG_DRAWWORK_DELETE(this.m_DrawInptr);
            }
        }

        [DllImport("KMGisLib")]
        public static extern int KWG_DRAWWORK_CREATE();
        [DllImport("KMGisLib")]
        public static extern void KWG_DRAWWORK_DELETE(int drawwork_ptr);

        public int DrawInptr
        {
            get
            {
                return this.m_DrawInptr;
            }
        }
    }
}

